<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>文件系统统计</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<!-- 新 Bootstrap 核心 CSS 文件 
jQuery文件。务必在bootstrap.min.js 之前引入
 最新的 Bootstrap 核心 JavaScript 文件 -->
<link rel="stylesheet" href="./js/bootstrap_3.3.5/css/bootstrap.css">
<script src="./js/jquery_1.11/jquery-1.11.3.min.js"></script>
<script src="./js/bootstrap_3.3.5/js/bootstrap.js"></script>
<!-- ztree  -->
<link href="./js/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet">
<script src="./js/ztree/js/jquery.ztree.all-3.5.js"></script>



<!-- highcharts  -->
<script src="./js/highcharts/highcharts.src.js"></script>

<!-- md5  -->
<script type="text/ecmascript" src="./js/md5/md5.js"></script>

<!-- alert  -->
<link href="./js/select/select.css" rel="stylesheet">


</head>
<body>



	<div class="container-fluid" style="margin-top: 10px;">
		<h5 id="datainfo"></h5>
		<table class="table table-hover">
			<thead>
				<tr>
					<th>名称</th>
					<th>文件系统</th>
					<th>使用率</th>
					<!-- 		<th>时间</th> -->
					<!-- 			<th>主机</th> -->
				</tr>
			</thead>
			<tbody id="datalist">
			</tbody>
		</table>
	</div>

	<script>
		var project = "/dt";
		$.ajax({
			type : "POST",
			url : project + "/api/zb/getFsUsed.do",
			data : {
				top : "10"
			},
			dataType : 'json',
			success : function(res) {
				if (res.success) {
					var rdata = res.data.data;
					var vhtml = "";
					$("#datainfo").html(
							"主机总数:" + res.data.cnt + " 最小记录时间:"
									+ res.data.minrtime);
					for (var i = 0; i < rdata.length; i++) {
						var bc = "  ";

						if (rdata[i].used >= 90) {
							bc = " style='background-color:red' ";
						}
						vhtml = vhtml + " <tr "+bc+" >";
						vhtml = vhtml + "<td>" + rdata[i].name + "</td>";
						vhtml = vhtml + "<td>" + rdata[i].metricname + "</td>";
						vhtml = vhtml + "<td>" + rdata[i].used + "%</td>";
						/* 	vhtml=vhtml+"<td>"+rdata[i].rtime+"</td>"; */

						/* 	vhtml=vhtml+"<td>"+rdata[i].host+"</td></tr>"; */
						vhtml = vhtml + "</tr>"
					}

					$("#datalist").html(vhtml);
				} else {
					alert("取数失败!");
				}
			}
		});
	</script>


</body>
</html>